using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UpgradeRandomizer:Upgrade {
	protected override void ProjectileFiringEventHandler(object _sender,ProjectileEventArgs e) {
		if(!IfReactProjectileEvent(_sender,e)) return;
		Projectile sender = _sender as Projectile;
		float statScale = Random.Range(0.8f,1.2f);
		if(Random.Range(0f,1f)<0.15f) statScale*=2;

		sender.stat.damage.AddMultiply(statScale,0);
		sender.stat.size.AddMultiply(statScale,0);
		sender.stat.timeTotal.AddMultiply(statScale,0);
		if(statScale>1.5f) {
			sender.stat.damagePrototype.crit=true;
			sender.stat.penetration.AddAdd(1,0);
		}
	}
}